{% extends "projetPHPidkdoBundle::layout.html.twig" %}

{% block title %}{{ parent() }} - Ajouter un cadeau{% endblock %}

{% block body %}
    <h2> Ajouter un cadeau </h2>
	
	<form method="POST" action="{{path('projetPHPidkdoBundle_ajouterCadeau')}}" enctype="multipart/form-data">
    	<table>
    		<tr>
	    		<td>Nom du cadeau *</td>
	    		<td><input name="nom" type="text" /></td>
    		</tr>
    		<tr>
	    		<td>Description</td>
	    		<td><textarea name="description" cols="" rows=""></textarea></td>
    		</tr>
			<tr>
	    		<td>Image (optionnelle)</td>
	    		<td><input name="image" type="file" /></td>
    		</tr>
			<tr>
	    		<td>Cadeau reçu ou offert ?</td>
	    		<td>Offert : <input name="estOffert" type="radio" value="1" checked /> Reçu : <input name="estOffert" type="radio" value="0" /></td>
    		</tr>
			<tr>
	    		<td>Offert par</td>
	    		<td><select name="id_offrant">
					{% for v_personne in liste_personnes %}
						<option value="{{ v_personne.id }}"> {{ v_personne.type }}</option>
					{% endfor %}
				</select></td>
    		</tr>
			<tr>
	    		<td>Reçu par</td>
	    		<td><select name="id_receveur">
					{% for v_personne in liste_personnes %}
						<option value="{{ v_personne.id }}"> {{ v_personne.type }}</option>
					{% endfor %}
				</select></td>
    		</tr>
			<tr>
	    		<td>Occasion</td>
	    		<td><select name="id_occasion">
					{% for v_occasion in liste_occasions %}
						<option value="{{ v_occasion.id }}"> {{ v_occasion.nom }}</option>
					{% endfor %}
					</select>
				</td>
    		</tr>
			<tr>
	    		<td>Genres *</td>
	    		<td><ul class="unstyled">
				{% for v_genre in liste_genres %}
					<li><input name="genres[]" value="{{ v_genre.id }}" type="checkbox" /> {{ v_genre.nom }}</li>
				{% endfor %}
				</ul></td>
    		</tr>
    	</table>
		<button class="btn" type="submit" ><i class="icon-plus"></i>Ajouter cadeau</button>
	</form>

{% endblock %}